from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import DeliveryViewSet, DeliveryRouteViewSet, DeliveryLogViewSet

router = DefaultRouter()
router.register(r'deliveries', DeliveryViewSet)
router.register(r'routes', DeliveryRouteViewSet)
router.register(r'logs', DeliveryLogViewSet)

urlpatterns = [
    path('', include(router.urls)),
    path('task/<int:id>/status/', DeliveryViewSet.as_view({'post': 'update_status'}), name='delivery-status'),
]